Hello together, |
Re: Export requirements automatically if heading is found
If 'Sensors' is always section 3.5 then you can filter the module for every object in that section; specifically those objects whose "number" is exactly "3.5" or those that start with "3.5.". Then export the current module. You could also filter based on the recursive child object loop, for oChild in o do; accepting all such objects after first rejecting all objects in the module. If you get the section Object handle, you can determine if an object is therein by recursivly considering each Parent of obj, until oSection is found (true) or you have no more parents (false).
bool IsInSection(Object obj, string Section)
{ // Is the object in the section?
// Section is the number() of the parent object, looks like "3.2.1"
if (null obj or null Section) return(false)
string Para = number(obj)
if (Para == Section or
(length(Para) > length(Section) and Para[0:length(Section)-1] == Section)) //
then return(true)
else return(false)
} // end IsInSection()
filtering off
// for all objects:
for obj in entire mod do
{ if (isDeleted(obj)) //
then reject(obj)
elseif (IsInSection(obj, "3.5") //
then accept(obj)
else reject(obj)
}
filtering on
// for displayed objects:
for obj in mod do
{ export obj)
}
|